feat: add apisixupstream controller#169
Merged
Merged
Conversation
…eam handling - Remove legacy ApisixUpstream controller. - Update related CRDs and deepcopy functions. - Add new translator logic for ApisixUpstream. - Introduce indexing and mapping logic for ApisixUpstream in ApisixRoute reconciliation.
- Implement `translateApisixUpstream` to support ApisixUpstream translation. - Add handling for externalNodes with types Domain and Service. - Update ApisixRoute translator to integrate ApisixUpstream references. - Introduce `SchemeToPort` and `MatchHostDef` utility functions for validation and defaults. - Enable e2e tests for ApisixRoute referencing ApisixUpstream.
- Moved HTTP rule handling to `processApisixRouteHTTPRule` for improved modularity. - Updated ApisixRoute controller to integrate the new function. - Enhanced indexing for ApisixRoute to include ApisixUpstream secrets and services. - Refactored e2e tests to validate updated ApisixRoute and ApisixUpstream logic.
…lators - Removed redundant `apisixUpstreams` and `adcUpstreams` variables in ApisixRoute translator logic for clarity. - Streamlined upstream handling and variable naming in traffic-split logic. - Updated TODO comments to reflect upcoming `.Checks`, `.TLS`, and `.Discovery*` implementations.
…ests - Refactor `NewDefaultUpstream` initialization for streamlined field ordering. - Update e2e framework's `GetServiceEndpoints` to accept `types.NamespacedName`. - Incorporate upstream weights into traffic-split logic, including default handling and labels. - Add comprehensive e2e tests for mixed backend and upstream scenarios.
…upstream # Conflicts: # internal/controller/apisixroute_controller.go # internal/controller/indexer/indexer.go # internal/provider/adc/translator/apisixroute.go
- Introduce a new ApisixUpstream controller for resource management. - Update CRDs with `subresources.status` and define ApisixUpstreamStatus schema. - Refactor ApisixPluginConfig reconciliation by removing unused logic and improving error handling. - Enhance e2e tests to validate ApisixRoute referencing ApisixUpstream. - Add copy logic for ApisixUpstream status in generated deepcopy functionality.
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-19T01:26:39Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRouteCrossNamespace
result: failure
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 1
Passed: 31
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests failed with 1 test failures. |
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-19T01:29:23Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
result: partial
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 0
Passed: 32
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests partially succeeded with 1 test skips. |
…upstream-controller # Conflicts: # internal/controller/apisixupstream_controller.go # test/e2e/apisix/route.go
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new ApisixUpstream controller to enhance the management of upstream resources. Key changes include:
- Adding the ApisixUpstream controller implementation and its integration in the manager.
- Updating end-to-end tests to use the new applier.MustApplyAPIv2 API.
- Enhancing CRD definitions to support status subresources.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/apisix/route.go | Updated test cases to utilize applier.MustApplyAPIv2 for resource creation. |
| internal/manager/controllers.go | Registered the new ApisixUpstreamReconciler for controller setup. |
| internal/controller/apisixupstream_controller.go | Introduced the ApisixUpstream controller implementation. |
| internal/controller/apisixpluginconfig_controller.go | Simplified the processIngressClassParameters function signature. |
| docs/crd/api.md | Added new documentation sections for CRD updates. |
| config/crd/bases/apisix.apache.org_apisixupstreams.yaml | Extended the CRD definition with new status properties and subresources. |
| api/v2/zz_generated.deepcopy.go | Updated deep copy functionality to include the new status field. |
| api/v2/apisixupstream_types.go | Added the status field and corresponding kubebuilder markers. |
Comments suppressed due to low confidence (1)
config/crd/bases/apisix.apache.org_apisixupstreams.yaml:537
- [nitpick] For consistency and clarity, consider quoting 'Unknown' in the enum so that it matches the other quoted enum values.
- Unknown
ronething
reviewed
Jun 19, 2025
| NamespacedName: utils.NamespacedName(au), | ||
| Resource: &apiv2.ApisixUpstream{}, | ||
| Mutator: status.MutatorFunc(func(obj client.Object) client.Object { | ||
| cp := obj.(*apiv2.ApisixUpstream).DeepCopy() |
Contributor
There was a problem hiding this comment.
It can be asserted first whether it is of the type '*apiv2.ApisixUpstream'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change:
What this PR does / why we need it:
add ApisixUpstream controller
Pre-submission checklist: